﻿@{
    ViewBag.Title = "我的预约";
}
@model List<zqdn.Web.ViewModels.MyAppointViewModel>

<div class="wrap">
    <div class="pat-appointment-page common-list">
        @if (Model.Count == 0)
        {
            <p style='text-align:center;margin-top:10px;'>暂无信息！</p>
        }
        @foreach (var item in Model)
        {
            <div class="list-data">
                <ul>
                    <li class="items" id="left">
                        <div>
                            <img class="list-left-img" src="~/content/images/appoint-icon.png" alt="我的预约">
                        </div>
                    </li>
                    <li class="items" id="center">
                        <input type="hidden" value="@item.Status" id="status"/>
                        <input type="hidden" value="@item.ID" id="appid" />
                        <div class="nocenter">
                            <p class="title">@item.OperationName</p>
                            <p class="user-message">
                                <span class="m2 @(item.Status == 0 ? "status4" : item.Status == 1 ? "status1" : item.Status == 2 ? "status2" : "status3")">
                                    @switch(item.Status){
                                        case 0:
                                            @("已预约")
                                            break;
                                        case 1:
                                            @("预约成功")
                                            break;
                                        case 2:
                                            @("已付定金")
                                            break;
                                        case 3:
                                            @("已完成")
                                            break;

                                    }
                                </span>
                                <span class="m3">@item.TimeGap.ToShortDateString()</span>
                            </p>
                        </div>
                    </li>

                    <li class="items" id="right"></li>
                </ul>
            </div>
        }
    </div>
</div>


@section scripts
{
    <script type="text/javascript">
        $(function () {
            $(".items").on("click", function () {
                var _appid=$(this).find("#appid").val();
                var _status = $(this).find("#status").val();
                if (_status === "0") {
                    layer.open({
                        content: "医生暂未处理该条预约信息,无法进行相关操作！",
                        btn: ['确定']
                    })
                } else {
                    ///添加患者信息
                    location.href = "/HosCenter/AppointApply/" + _appid + "";
                }
            });
        });
    </script>
}
